package com.steel.yfmall.cloud.assistant.controller;

import com.steel.yfmall.cloud.assistant.api.stock.OrderLogisticsService;
import com.steel.yfmall.cloud.assistant.bean.param.ParaCreateOrderDepotShipBean;
import com.steel.yfmall.cloud.components.utils.base.APIMsgBean;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


/**
 * 对接物流
 *
 * @param null
 * @return
 * @author yaokan
 * @date 2021-01-08 16:14
 */
@RestController
@Slf4j
public class OrderLogisticsController {

    @Resource
    private OrderLogisticsService orderLogisticsService;

    @RequestMapping("createOrderDepotShip")
    public APIMsgBean<Boolean> createOrderDepotShip(@RequestBody ParaCreateOrderDepotShipBean paraCreateOrderDepotShipBean) {
        APIMsgBean<Boolean> orderDepotShip = orderLogisticsService.createOrderDepotShip(paraCreateOrderDepotShipBean);
        return orderDepotShip;
    }

    /**
     * 添加订单汽运的派车信息
     *
     * @param null
     * @return
     * @author yaokan
     * @date 2021-04-05 17:34
     */
    @RequestMapping("updateDriver")
    public APIMsgBean<Boolean> updateDriver(@RequestBody ParaCreateOrderDepotShipBean paraCreateOrderDepotShipBean) {
        APIMsgBean<Boolean> orderDepotShip = orderLogisticsService.updateDriver(paraCreateOrderDepotShipBean);
        return orderDepotShip;
    }

    /**
     * 车辆进场，订单确认接口
     * @param paraCreateOrderDepotShipBean
     * @return
     * @author yaokan
     * @date 2021-04-05 17:34
     */
    @RequestMapping("orderConfirm")
    public APIMsgBean<Boolean> orderConfirm(@RequestBody ParaCreateOrderDepotShipBean paraCreateOrderDepotShipBean) {
        APIMsgBean<Boolean> orderDepotShip = orderLogisticsService.orderConfirm(paraCreateOrderDepotShipBean);
        return orderDepotShip;
    }
}
